package org.apache.http.message;

import org.apache.http.Header;
import org.apache.http.HeaderIterator;
import org.apache.http.HttpMessage;
import org.apache.http.annotation.NotThreadSafe;
import org.apache.http.params.HttpParams;
import org.apache.http.params.b;

@NotThreadSafe
public abstract class a implements HttpMessage {
    protected i a;
    @Deprecated
    protected HttpParams b;

    public void addHeader(String str, String str2) {
        org.apache.http.a.a.a((Object) str, "Header name");
        this.a.a(new b(str, str2));
    }

    public void addHeader(Header header) {
        this.a.a(header);
    }

    public boolean containsHeader(String str) {
        return this.a.d(str);
    }

    public Header[] getAllHeaders() {
        return this.a.b();
    }

    public Header getFirstHeader(String str) {
        return this.a.b(str);
    }

    public Header[] getHeaders(String str) {
        return this.a.a(str);
    }

    public Header getLastHeader(String str) {
        return this.a.c(str);
    }

    @Deprecated
    public HttpParams getParams() {
        if (this.b == null) {
            this.b = new b();
        }
        return this.b;
    }

    public HeaderIterator headerIterator() {
        return this.a.c();
    }

    public HeaderIterator headerIterator(String str) {
        return this.a.e(str);
    }

    public void removeHeader(Header header) {
        this.a.b(header);
    }

    public void removeHeaders(String str) {
        if (str != null) {
            HeaderIterator c = this.a.c();
            while (c.hasNext()) {
                if (str.equalsIgnoreCase(c.nextHeader().getName())) {
                    c.remove();
                }
            }
        }
    }

    public void setHeader(String str, String str2) {
        org.apache.http.a.a.a((Object) str, "Header name");
        this.a.c(new b(str, str2));
    }

    public void setHeader(Header header) {
        this.a.c(header);
    }

    public void setHeaders(Header[] headerArr) {
        this.a.a(headerArr);
    }

    @Deprecated
    public void setParams(HttpParams httpParams) {
        this.b = (HttpParams) org.apache.http.a.a.a((Object) httpParams, "HTTP parameters");
    }
}
